# 右对齐三角形
for i in range(1,6):
    b = 5
    print(" "*(b-i)+"*"*i,end="\n")


# 正三角形
for i in range(1,5):
    b = 5
    print(" "*(b-i),end="")
    a = i*2-1
    for c in range(a):
        print("*",end="")
    print()



# 上下颠倒正三角形
for i in range(15):
    for a in range(0,i):
        print(end=" ")
    for b in range(i,15-i):
        print("*",end="")

    print()


# 菱形
for i in range(9):
    for a in range(9-i):
        print(" ",end="")
    a = i*2-1
    for c in range(a):
        print("*",end="")
    print()
for i in range(15):
    for a in range(0,i):
        print(end=" ")
    for b in range(i,15-i):
        print("*",end="")

    print()



# 下三角形
# **********
#  ********
#   ******
#    ***
#     *

# 第n层星星数
# 1  2*n-1
# 2  2*n-3
# 3  2*n-5
# 4  2*n-7
# n  2*n-9

# 打印的总层数
n = int(input("请输入要打印三角形的层数：\n"))
for i in range(1, n + 1):
    # 打印星星前空格+打印星星+打印星星后空格
    print((i-1) * " " + (2 * n - (2 * i-1)) * "*" + (i-1) * " ")




# 右三角形
#     *
#    **
#   ***
#  ****
# *****


# 手动输入需要打印三角形的层数
num = int(input("请输入要打印三角形的层数：\n"))

for i in range(1, num + 1):
    # 打印空格,末尾不换行
    print((num - i) * " ", end="")
    # 打印星星
    print(i * "*")







# # 正三角形
#     *
#    ***
#   ******
#  ********
# **********

# 第n层星星数
# 1  1
# 2  3
# 3  5
# 4  7
# n  2*n-1

# 打印的总层数
n = int(input("请输入要打印三角形的层数：\n"))
for i in range(1, n + 1):
    # 打印星星前空格+打印星星+打印星星后空格
    print((n - i) * " " + (2 * i - 1) * "*" + (n - i) * " ")




# 菱形
#     *
#    ***
#   ******
#  ********
# **********
#  ********
#   ******
#    ***
#     *

n = int(input("请输入要打印三角形的层数：\n"))
for i in range(1, n + 1):
    # 打印星星前空格+打印星星+打印星星后空格
    print((n - i) * " " + (2 * i - 1) * "*" + (n - i) * " ")

for i in range(2, n + 1):
    # 打印星星前空格+打印星星+打印星星后空格
    print((i-1) * " " + (2 * n - (2 * i-1)) * "*" + (i-1) * " ")